package com.xs.project.controller;

import com.xs.project.common.Result;
import com.xs.project.pojo.vo.CompanyReq;
import com.xs.project.pojo.vo.StuCompanyReq;
import com.xs.project.pojo.vo.resp.StuCompanyResp;
import com.xs.project.pojo.vo.resp.XcCourseResp;
import com.xs.project.pojo.vo.resp.XsCompany;
import com.xs.project.service.ICompanyManagerService;
import com.xs.project.service.ICourseManagerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/companyManager")
@Api(tags = "就业公司管理")
public class CompanyManagerController {
    @Resource
    private ICompanyManagerService companyManagerService;
    @ApiOperation(value = "公司-列表", notes = "公司资源")
    @PostMapping(value = "/selectCompanyList")
    public Result<List<XsCompany>> selectCompanyList(@RequestBody CompanyReq req) {
        return companyManagerService.selectCompanyList(req);
    }

    @ApiOperation(value = "公司-更新", notes = "公司资源")
    @PostMapping(value = "/updateCompanyList")
    public Result<Boolean> updateCompanyList(@RequestBody XsCompany request) {
        return Result.success(companyManagerService.updateCompanyList(request));
    }

    @ApiOperation(value = "公司-新增", notes = "公司资源")
    @PostMapping(value = "/insertCompanyList")
    public Result<Boolean> insertCompanyList(@RequestBody XsCompany request) {
        return Result.success(companyManagerService.insertCompanyList(request));
    }

//    学生就业

    @ApiOperation(value = "学生就业-列表", notes = "公司资源")
    @PostMapping(value = "/selectStuCompanyList")
    public Result<List<StuCompanyResp>> selectStuCompanyList(@RequestBody StuCompanyReq request) {
        return companyManagerService.selectStuCompanyList(request);
    }

    @ApiOperation(value = "学生就业-更新", notes = "公司资源")
    @PostMapping(value = "/updateStuCompanyList")
    public Result<Boolean> updateStuCompanyList(@RequestBody StuCompanyResp request) {
        return Result.success(companyManagerService.updateStuCompanyList(request));
    }

    @ApiOperation(value = "学生就业-新增", notes = "公司资源")
    @PostMapping(value = "/insertStuCompanyList")
    public Result<Boolean> insertStuCompanyList(@RequestBody StuCompanyResp request) {
        return Result.success(companyManagerService.insertStuCompanyList(request));
    }
}
